<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>标题</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/buildUnit/common.css">
    <link rel="stylesheet" href="/statics/layui/font/font.css" media="all"/>
    <style type="text/css">
        html, body {
            height: 100%;
            overflow-y: auto;
        }
    </style>
</head>
<body>
<form class="layui-form layui-form-pane" id="example" lay-filter="formData">
    <div class="layui-fluid">
        <table class="layui-table v-table">
            <tbody>
            <tr>
                <td class="th8 required">证书编号</td>
                <td colspan="3">
                    <input type="hidden" name="id" class="formData">
                    <input type="text" name="aptitudeNo" lay-verify="isEmpty" placeholder="证书编号"
                           autocomplete="off"
                           class="layui-input formData">
                </td>
            </tr>
            <tr>
                <td class="th8 required">证书有效期</td>
                <td colspan="3">
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input time formData" placeholder="请选择" name="expiryStartTime"
                               lay-verify="isEmpty"
                               id="expiryStartTime" readonly/>
                    </div>
                    至
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input time formData" placeholder="请选择" name="expiryEndTime"
                               lay-verify="isEmpty"
                               id="expiryEndTime" readonly/>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="th8 required">发证日期</td>
                <td>
                    <input type="text" class="layui-input time formData" placeholder="请选择" name="grantTime"
                           lay-verify="isEmpty"
                           id="grantTime" readonly/>
                </td>
                <td class="th8 required">发证机关</td>
                <td>
                    <input type="text" name="authority" lay-verify="isEmpty" placeholder=""
                           autocomplete="off"
                           class="layui-input formData">
                </td>
            </tr>
            <tr>
                <td class="th8">业务范围</td>
                <td colspan="3">
                    <textarea name="qrPath" id="qrPath" cols="30" rows="10" class="formData" style="width:100%;"></textarea>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <button lay-submit lay-filter="submit" style="display: none;" id="submit" class="demo1">提交</button>
</form>
<script type="text/javascript" src="/lib/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
<!--<script type="text/javascript" src="../../../statics/js/sys/editDict.js"  charset="utf-8"></script>-->
<script>
    layui.use(['form', 'sessionFun', 'configure', 'configureCom', 'laydate'], function () {
        window.$ = layui.$;
        var form = layui.form;
        var configure = layui.configure;
        var configureCom = layui.configureCom;
        var laydate = layui.laydate;
        var sessionFun = layui.sessionFun;
        //执行一个laydate实例
        $('.time').each(function (index, item) {
            laydate.render({
                elem: item, //指定元素
                format: 'yyyy-MM-dd'
            });
        });
        var listData = sessionFun.get(configure.SESSION_ZIZHI_LIST_DATA);
        if (listData) {
            configureCom.selectDataFun(configure.CERT_TYPE_CODE, listData.registerType, '#registerType');
            configureCom.selectDataFun(configure.SPECIALTY_TYPE_CODE, listData.aptitudeSpeciality, '#aptitudeSpeciality');
            form.val('formData', listData);
        } else {
            configureCom.selectDataFun(configure.CERT_TYPE_CODE, '', '#registerType');
            configureCom.selectDataFun(configure.SPECIALTY_TYPE_CODE, '', '#aptitudeSpeciality');
        }
        form.render();
        form.on('submit(submit)', function (data) {
            return false;
        });
    });

    function getData() {
        return new Promise(function (resolve, reject) {
            if (!window.formVerifyFun()) {
                return false;
            }
            var data = {};
            $('.formData').each(function (index, item) {
                var key = $(item).attr('name');
                data[key] = $(item).val();
            });
            resolve({result: data});
        })
    }
</script>
</body>
</html>
